{% extends 'application.html' %}
{% block content %}
<div class="row">
    <div class="span6">
        <ul class="nav nav-tabs">
            <li class="active"><a href="/sites">网站列表</a></li>
            <li><a href="/site/new">添加网站</a></li>
        </ul>
    </div>
    <div class="span6">
        <form class="navbar-form pull-right">
            <input type="text" class="span3" placeholder="站点域名">
            <button type="submit" class="btn">查询</button>
        </form>
    </div>
</div>
<div class="row">
    <div class="span12">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th class="span2">#</th>
                    <th class="span2">名称</th>
                    <th class="span3">域名</th>
                    <th class="span2">状态</th>
                    <th class="span2">本月流量</th>
                    <th class="span4">操作</th>
                </tr>
            </thead>
            <tbody>
                {% for site in sites %}
                <tr>
                    <td>{{site.id}}</td>
                    <td>{{site.name}}</td>
                    <td>{{site.domain}}</td>
                    <td>
                        {% if site.is_cname == 1 %}
                        <span class="label label-success">正常</span>
                        {% else %}
                        <a href="/site/{{site.id}}/help"><span class="label label-warning">未解析</span></a>
                        {% endif %}
                    </td>
                    <td>1.2M</td>
                    <td>
                        <a class="btn btn-mini" href="/site/{{site.id}}">查看</a>
                        <a class="btn btn-mini" href="/site/{{site.id}}/edit">设置</a>
                        <a class="btn btn-mini" href="/site/{{site.id}}/destory" onclick="javascript:confirm('确认删除?')">删除</a>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}
